package com.yzy.soft.common.persistence.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.annotation.JSONType;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
@JSONType(orders={"type","field","title","width","sort","totalRow","align","unresize"})
@TableName(value="html_table_col")
public class HtmlTableCol {
    @TableId(type= IdType.AUTO)
    @JSONField(serialize=false)
    private Integer id;
    // 表头
    @JSONField(ordinal=1)
    private String type;
    @JSONField(ordinal=2)
    private String field;
    @JSONField(ordinal=3)
    private String title;
    @JSONField(ordinal=4)
    private boolean sort = true;
    @TableField(value="total_row")
    @JSONField(ordinal=5)
    private boolean totalRow = true;
    //templet: "<div>{{layui.util.toDateString(d.create)}}</div>" '#switchTpl'
    @JSONField(serialize=false)
    private String templet;
    @JSONField(ordinal=6)
    private String align = "center";
    @JSONField(ordinal=7)
    private boolean unresize = true;
    @JSONField(serialize=false)
    private String fixed = "left";
    @JSONField(ordinal=8)
    private Integer width=100;
    @JSONField(serialize=false)
    private String remarks;
    @JSONField(serialize=false)
    private String code;

    @JSONField(serialize=false)
    @TableField(value="table_id")
    private Integer tableId;
    @JSONField(serialize=false)
    @TableField(value="html_id")
    private Integer htmlId;


    /**
     *创建时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(value="createtime",fill= FieldFill.INSERT)
    @JSONField(serialize=false)
    private Date createtime;

    /**
     *最后一次修改时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(value="lastupdatetime",fill= FieldFill.INSERT_UPDATE)
    @JSONField(serialize=false)
    private Date lastupdatetime;

    /**
     *创建目的
     */
    @JSONField(serialize=false)
    private String makegoal;

    /**
     *最后一次修改目的
     */
    @JSONField(serialize=false)
    private String lastupdategoal;

    /**
     *状态
     */
    @JSONField(serialize=false)
    private Integer userflag;

    /**
     *
     */
    @JSONField(serialize=false)
    private String deleteflag;

    /**
     *
     */
    @JSONField(serialize=false)
    private String spareflag1;

    /**
     *
     */
    @JSONField(serialize=false)
    private String spareflag2;

    /**
     *
     */
    @JSONField(serialize=false)
    private String spareflag3;

    /**
     *
     */
    @JSONField(serialize=false)
    private String spareflag4;

    /**
     *
     */
    @JSONField(serialize=false)
    private String spareflag5;

    /**
     *
     */
    @JSONField(serialize=false)
    private String sparefield1;

    /**
     *
     */
    @JSONField(serialize=false)
    private String sparefield2;

    /**
     *
     */
    @JSONField(serialize=false)
    private String sparefield3;

    /**
     *
     */
    @JSONField(serialize=false)
    private String sparefield4;

    /**
     *
     */
    @JSONField(serialize=false)
    private String sparefield5;

    /**
     *
     */
    @JSONField(serialize=false)
    private String sparefield6;




    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getField() {
        return field;
    }

    public void setField(String field) {
        this.field = field;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public boolean getSort() {
        return sort;
    }

    public void setSort(boolean sort) {
        this.sort = sort;
    }

    public boolean getTotalRow() {
        return totalRow;
    }

    public void setTotalRow(boolean totalRow) {
        this.totalRow = totalRow;
    }

    public String getTemplet() {
        return templet;
    }

    public void setTemplet(String templet) {
        this.templet = templet;
    }

    public String getAlign() {
        return align;
    }

    public void setAlign(String align) {
        this.align = align;
    }

    public boolean getUnresize() {
        return unresize;
    }

    public void setUnresize(boolean unresize) {
        this.unresize = unresize;
    }

    public String getFixed() {
        return fixed;
    }

    public void setFixed(String fixed) {
        this.fixed = fixed;
    }

    public Integer getWidth() {
        return width;
    }

    public void setWidth(Integer width) {
        if(null!=width){
            this.width = width;
        }
    }

    public boolean isSort() {
        return sort;
    }

    public boolean isTotalRow() {
        return totalRow;
    }

    public boolean isUnresize() {
        return unresize;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }
}
